import{d as e,M as l,A as c,h as o}from"./Anchors-CRD96j4l.js";import{D as s,a as i}from"./Demo-Ck8WGKWN.js";import"./index-BpvWz174.js";const r={path:"/view/notice",name:"notice",title:"Notice 通知"};function d(n){const t={a:"a",br:"br",code:"code",h1:"h1",h2:"h2",p:"p",span:"span",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...n.components};return l(o,{children:[l("div",{class:"sys-ctx-main-left",children:[l(t.h1,{id:"sp-",children:[e(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#sp-",children:e(t.span,{className:"icon icon-link"})}),r.title]}),l(t.h2,{id:"sp-demos",children:[e(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#sp-demos",children:e(t.span,{className:"icon icon-link"})}),"代码演示 "]}),e(s,{columns:2}),e(i,{id:"base",title:"基本用法",src:"1base.demo.tsx",code:`import { Button, notice } from "cui-solid";

export default () => {
    return <Button onClick={() => {
        notice.info({
            title: '提示',
            content: '提示内容',
        });
    }}>消息</Button>
}`,scopes:void 0,children:l(t.p,{children:["基础用法， ",e(t.code,{className:"sp-inline-code",children:"notice"})," 为全局对象"]})}),e(i,{id:"type",title:"不同类型的通知",src:"2type.demo.tsx",code:`import { Button, notice, Space } from "cui-solid";

export default () => {
    return <Space dir="h">
        <Button onClick={() => {
            notice.info({
                title: '提示',
                content: '提示内容',
            });
        }}>消息</Button>
        <Button type="success" onClick={() => {
            notice.success({
                title: '提示',
                content: '成功信息',
            });
        }}>成功</Button>
        <Button type="warning" onClick={() => {
            notice.warning({
                title: '告警',
                content: '告警事件2023年3月24日11:40:29',
            });
        }}>告警</Button>
        <Button type="error" onClick={() => {
            notice.error({
                title: '错误',
                content: '事件提交失败',
            });
        }}>错误</Button>
        <Button type="default" onClick={() => {
            notice.help({
                title: '帮助',
                content: 'ls 命令',
            });
        }}>帮助</Button>
    </Space>
}`,scopes:void 0,children:l(t.p,{children:[e(t.code,{className:"sp-inline-code",children:"notice"})," 不同的通知 可以使用不通的方法触发，包含 ",e(t.code,{className:"sp-inline-code",children:"info"})," ",e(t.code,{className:"sp-inline-code",children:"success"}),e(t.br,{}),`
`,e(t.code,{className:"sp-inline-code",children:"warning"})," ",e(t.code,{className:"sp-inline-code",children:"error"})," ",e(t.code,{className:"sp-inline-code",children:"help"})]})}),e(i,{id:"dock",title:"位置",src:"3dock.demo.tsx",code:`import { Button, notice, Space } from "cui-solid";

export default () => {
    return <Space dir="h">
        <Button onClick={() => {
            notice.info({
                title: '提示',
                content: '提示内容',
                dock: 'bottomRight'
            });
        }}>右下角</Button>

        <Button onClick={() => {
            notice.info({
                title: '提示',
                content: '提示内容',
                dock: 'topLeft'
            });
        }}>左上角</Button>

        <Button onClick={() => {
            notice.info({
                title: '提示',
                content: '提示内容',
                dock: 'bottomLeft'
            });
        }}>左下角</Button>
    </Space>
}`,scopes:void 0,children:l(t.p,{children:[e(t.code,{className:"sp-inline-code",children:"dock"})," 属性定义通知出现的位置， 支持 ",e(t.code,{className:"sp-inline-code",children:"topRight(默认)"})," ",e(t.code,{className:"sp-inline-code",children:"bottomRight"})," ",e(t.code,{className:"sp-inline-code",children:"topLeft"})," ",e(t.code,{className:"sp-inline-code",children:"bottomLeft"})]})}),l(t.h2,{id:"props",children:[e(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#props",children:e(t.span,{className:"icon icon-link"})}),"属性 "]}),l(t.table,{className:"sp-table",children:[e(t.thead,{children:l(t.tr,{children:[e(t.th,{style:{textAlign:"left"},children:"属性"}),e(t.th,{style:{textAlign:"left"},children:"说明"}),e(t.th,{style:{textAlign:"left"},children:"类型"}),e(t.th,{style:{textAlign:"left"},children:"默认值"})]})}),l(t.tbody,{children:[l(t.tr,{children:[e(t.td,{style:{textAlign:"left"},children:"style"}),e(t.td,{style:{textAlign:"left"},children:"自定义样式"}),e(t.td,{style:{textAlign:"left"},children:"Object"}),e(t.td,{style:{textAlign:"left"}})]}),l(t.tr,{children:[e(t.td,{style:{textAlign:"left"},children:"key"}),e(t.td,{style:{textAlign:"left"},children:"消息的标识，调用close可根据key进行关闭"}),e(t.td,{style:{textAlign:"left"},children:"string"}),e(t.td,{style:{textAlign:"left"}})]}),l(t.tr,{children:[e(t.td,{style:{textAlign:"left"},children:"duration"}),e(t.td,{style:{textAlign:"left"},children:"显示时间，为0时不销毁"}),e(t.td,{style:{textAlign:"left"},children:"number"}),e(t.td,{style:{textAlign:"left"},children:"4"})]}),l(t.tr,{children:[e(t.td,{style:{textAlign:"left"},children:"dock"}),e(t.td,{style:{textAlign:"left"},children:"通知弹出的位置"}),e(t.td,{style:{textAlign:"left"},children:"topRight | topLeft | bottomLeft | bottomRight"}),e(t.td,{style:{textAlign:"left"},children:"topRight"})]}),l(t.tr,{children:[e(t.td,{style:{textAlign:"left"},children:"content"}),e(t.td,{style:{textAlign:"left"},children:"内容"}),e(t.td,{style:{textAlign:"left"},children:"JSXElement"}),e(t.td,{style:{textAlign:"left"}})]}),l(t.tr,{children:[e(t.td,{style:{textAlign:"left"},children:"title"}),e(t.td,{style:{textAlign:"left"},children:"标题"}),e(t.td,{style:{textAlign:"left"},children:"string | JSXElement"}),e(t.td,{style:{textAlign:"left"}})]}),l(t.tr,{children:[e(t.td,{style:{textAlign:"left"},children:"icon"}),e(t.td,{style:{textAlign:"left"},children:"图标"}),e(t.td,{style:{textAlign:"left"},children:"JSXElement"}),e(t.td,{style:{textAlign:"left"}})]}),l(t.tr,{children:[e(t.td,{style:{textAlign:"left"},children:"theme"}),e(t.td,{style:{textAlign:"left"},children:"主题"}),e(t.td,{style:{textAlign:"left"},children:"success | warning | error | info"}),e(t.td,{style:{textAlign:"left"}})]}),l(t.tr,{children:[e(t.td,{style:{textAlign:"left"},children:"btn"}),e(t.td,{style:{textAlign:"left"},children:"按钮"}),e(t.td,{style:{textAlign:"left"},children:"JSXElement"}),e(t.td,{style:{textAlign:"left"}})]}),l(t.tr,{children:[e(t.td,{style:{textAlign:"left"},children:"onClose"}),e(t.td,{style:{textAlign:"left"},children:"关闭回调函数"}),e(t.td,{style:{textAlign:"left"},children:"Function"}),e(t.td,{style:{textAlign:"left"}})]})]})]}),l(t.h2,{id:"events",children:[e(t.a,{"aria-hidden":"true",tabIndex:"-1",href:"#events",children:e(t.span,{className:"icon icon-link"})}),"事件 "]}),l(t.table,{className:"sp-table",children:[e(t.thead,{children:l(t.tr,{children:[e(t.th,{style:{textAlign:"left"},children:"事件名称"}),e(t.th,{style:{textAlign:"left"},children:"说明"}),e(t.th,{style:{textAlign:"left"},children:"返回值"})]})}),e(t.tbody,{children:l(t.tr,{children:[e(t.td,{style:{textAlign:"left"},children:e(t.code,{className:"sp-inline-code",children:"onClose"})}),e(t.td,{style:{textAlign:"left"},children:"关闭回调函数"}),e(t.td,{style:{textAlign:"left"}})]})})]})]}),`
`,`
`,`
`,e(c,{data:[{id:"",depth:1,title:""},{id:"sp-demos",depth:2,title:"代码演示"},{id:"base",title:"基本用法",src:"1base.demo.tsx"},{id:"type",title:"不同类型的通知",src:"2type.demo.tsx"},{id:"dock",title:"位置",src:"3dock.demo.tsx"},{id:"props",depth:2,title:"属性"},{id:"events",depth:2,title:"事件"}]})]})}function p(n={}){const{wrapper:t}=n.components||{};return t?e(t,{...n,children:e(d,{...n})}):d(n)}export{p as default,r as frontmatter};
